<div id="form"></div>
<script>

var arr=[
	{"type":"accordion","name":"blocks","mode":"blocks","label":"","pages":[{"id":"main-block","name":"Main information"}]},
	{
		type:"select",
		name:"fk",
		label:"<{>!Foregin keys<}>",
		values:[{id:"id",name:"<{>!IDs<}>"},{id:"name",name:"<{>!Names from other table, if 'name' column is available<}>"}],
		add_null:1,
		not_null:1,
		width:600,
		xpath:".main-block"
	},
	{
		type:"select",
		name:"filetype",
		label:"<{>!File type<}>",
		values:[{id:"csv",name:"<{>!CSV<}>"},{id:"xml",name:"<{>!XML<}>"},{id:"xlsx",name:"<{>!XLSX<}>"},{id:"json",name:"<{>!JSON<}>"}],
		add_null:1,
		not_null:1,
		width:600,
		xpath:".main-block"
	}
];

var frm=$("#form").ajajform({
	header: "<{>!{{mconfig.label}}<}>",
	footerButtons: [{
		url: '<{>action<}>',
		value: "<{>!Export<}>",
		params: {mode: "export2",ajaj: 1},
		click: function() {
			var href='<{>action<}>?<{>cols_through<}>ajaj=1&mode=export2&fk='+frm.ajajform("getWidgetValue","fk")+"&filetype="+frm.ajajform("getWidgetValue","filetype");
			document.location=href;
			//ajaj_href(href);
		},
	}]
});

ajajform_add_inputs(frm,arr);
</script>

